From 6363aeca69df2df6d3994f6d2591539f6378e898 Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Fri, 30 Mar 2018 17:21:13 +0200 Subject: [PATCH] docs(Z-flags): Add description for each -Z flag in cargo -Z help --- src/bin/cli.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/bin/cli.rs b/src/bin/cli.rs index da5f4eb59..ed5c4805d 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -10,6 +10,24 @@ use command_prelude::*; pub fn main(config: &mut Config) -> CliResult { let args = cli().get_matches_safe()?; + + if args.value_of("unstable-features") == Some("help") { + println!( + " +Available unstable (nightly-only) flags: + + -Z avoid-dev-deps -- Avoid installing dev-dependencies if possible + -Z minimal-versions -- Install minimal dependency versions instead of maximum + -Z no-index-update -- Do not update the registry, avoids a network request for benchmarking + -Z offline -- Offline mode that does not perform network requests + -Z print-im-a-teapot -- Example option for demonstration purposes + -Z unstable-options -- Allow the usage of unstable options such as --registry + +Run with 'cargo -Z [FLAG] [SUBCOMMAND]'" + ); + return Ok(()); + } + let is_verbose = args.occurrences_of("verbose") > 0; if args.is_present("version") { let version = cargo::version(); @@ -161,7 +179,7 @@ See 'cargo help ' for more information on a specific command.\n", .arg(opt("locked", "Require Cargo.lock is up to date").global(true)) .arg( Arg::with_name("unstable-features") - .help("Unstable (nightly-only) flags to Cargo") + .help("Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details") .short("Z") .value_name("FLAG") .multiple(true) -- 2.30.2